package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.Setmeal;
import com.itheima.pojo.dto.CheckGroupDTO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckSetmealMapper {

	@Select("select * from t_setmeal")
	List<Setmeal> getSetmeal();

	@Select("select * from t_setmeal where id = #{setmealId}")
	Setmeal findDetailById(Integer setmealId);


	void insertSetmeal(Setmeal setmeal);

	void insertAssociation(Integer setmealId, Integer setmealGroupId);

	@Delete("delete from t_setmeal_checkgroup where setmeal_id = #{id}")
	void deleteAssociation(Integer id);

	@Delete("delete from t_setmeal where id = #{id}")
	void delete(Integer id);

	void updateGroup(Setmeal setmeal);

	Page<CheckGroupDTO> getPage(QueryPageBean setmeal);
}
